﻿using Microsoft.AspNetCore.SignalR;
using System.Collections.Generic;


namespace Management.Systeam.Read.Apis
{
    public class StatisticsHub : Hub
    {

        public async Task SendRefractionImage(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }
        public async Task SendRefractionImage2(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }
        public async Task SendRefractionImage3(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }       public async Task SendRefractionImage4(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }       public async Task SendRefractionImage5(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }       public async Task SendRefractionImage6(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }       public async Task SendRefractionImage7(byte[] imageData)
        {
            await Clients.All.SendAsync("ReceiveRefractionImage", imageData);
        }




        //public async Task SendTodoItemsData(TodoItemsData data)
        //{
        //    await Clients.All.SendAsync("UpdateTodoItems", data);
        //}

        //// 推送预警信息数据
        //public async Task SendWarningInfoData(WarningInfoData data)
        //{
        //    await Clients.All.SendAsync("UpdateWarningInfo", data);
        //}

        //// 推送入库排名数据（柱状图）
        //public async Task SendInboundRankingData(InboundRankingData data)
        //{
        //    await Clients.All.SendAsync("UpdateInboundRanking", data);
        //}

        //// 推送出库排名数据（柱状图）
        //public async Task SendOutboundRankingData(OutboundRankingData data)
        //{
        //    await Clients.All.SendAsync("UpdateOutboundRanking", data);
        //}

        //// 推送系统消息数据
        //public async Task SendSystemMessageData(SystemMessageData data)
        //{
        //    await Clients.All.SendAsync("UpdateSystemMessages", data);
        //}

        //// 推送所有统计数据
        //public async Task SendAllStatisticsData(AllStatisticsData data)
        //{
        //    await Clients.All.SendAsync("UpdateAllStatistics", data);
        //}

        //// 推送图表配置更新
        //public async Task SendChartConfigUpdate(string chartType, ChartConfig config)
        //{
        //    await Clients.All.SendAsync("UpdateChartConfig", chartType, config);
        //}

        //// 推送实时数据更新通知
        //public async Task SendDataUpdateNotification(string dataType, string message)
        //{
        //    await Clients.All.SendAsync("DataUpdateNotification", dataType, message, DateTime.Now);
        //}

        //// 推送预警通知
        //public async Task SendWarningNotification(WarningItem warning)
        //{
        //    await Clients.All.SendAsync("WarningNotification", warning);
        //}

        //// 推送系统通知
        //public async Task SendSystemNotification(SystemMessage message)
        //{
        //    await Clients.All.SendAsync("SystemNotification", message);
        //}

        //// 客户端连接时


        //// 客户端断开连接时


        //// 客户端加入特定组（如特定仓库的数据更新）
        //public async Task JoinWarehouseGroup(string warehouseId)
        //{
        //    await Groups.AddToGroupAsync(Context.ConnectionId, $"warehouse_{warehouseId}");
        //    await Clients.Group($"warehouse_{warehouseId}").SendAsync("UserJoinedWarehouse", Context.ConnectionId, warehouseId);
        //}

        //// 客户端离开特定组
        //public async Task LeaveWarehouseGroup(string warehouseId)
        //{
        //    await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"warehouse_{warehouseId}");
        //    await Clients.Group($"warehouse_{warehouseId}").SendAsync("UserLeftWarehouse", Context.ConnectionId, warehouseId);
        //}

        //// 向特定仓库组推送数据
        //public async Task SendWarehouseData(string warehouseId, object data)
        //{
        //    await Clients.Group($"warehouse_{warehouseId}").SendAsync("WarehouseDataUpdate", warehouseId, data);
        //}
    }
}